<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <button id="btn">按钮</button>
  <p></p>
  <script>
    // 聊一聊vue的双向数据绑定的原理么?  数据驱动视图的原理??
    const btn = document.querySelector('button')
    const p = document.querySelector('p')
    // 事件绑定
    /* btn.onclick = ()=>{
      console.log(1);
    }
    btn.onclick = ()=>{
      console.log(2);
    }
    btn.onclick = ()=>{
      console.log(3);
    } */
    // 事件监听
   /*  btn.addEventListener('click',()=>{
      console.log(1);
    })
    btn.addEventListener('click',()=>{
      console.log(2);
    })
    btn.addEventListener('click',()=>{
      console.log(3);
    }) */

    // Object.defineProperty()
 /*  const obj = {a: 10}
  p.innerHTML = obj.a
  btn.addEventListener('click',()=>{
      obj.a = 100
  }) */
  </script>
</body>
</html>